using System;
using EPiServer.Common;
using EPiServer.Common.Security;

namespace EPiAbstractions.Community
{
    public interface IDefaultSecurityHandlerFacade
    {
        Boolean AuthenticateUser(String userName, String passWord, out IUser user);

        IGroup AddGroup(IGroup group);

        IUser AddUser(IUser user);

        IGroup GetGroup(Int32 groupId);

        IGroup GetGroupByName(String name);

        IUser GetUser(Int32 userId);

        IUser GetUserByUserName(String userName);

        UserCollection GetUsersByEMail(String email);

        UserCollection GetUsersByAlias(String alias);

        IUser GetUser(Int32 userId, Boolean loadAll);

        GroupCollection GetGroups();

        UserCollection GetUsers();

        UserCollection GetGroupUsers(IGroup group);

        GroupCollection GetUserGroups(IUser user);

        GroupCollection GetParentGroups(IGroup childGroup);

        GroupCollection GetChildGroups(IGroup parentGroup);

        void RemoveGroup(IGroup group);

        void RemoveUser(IUser user);

        void RemoveUser(IUser user, Boolean permanent);

        void UpdateGroup(IGroup group);

        void UpdateUser(IUser user);

        GroupCollection GetModuleGroups(String module);

        UserCollection GetModuleUsers(String module);

        GroupCollection GetSiteGroups(ISite site);

        UserCollection GetSiteUsers(ISite site);

        GroupCollection FindGroups(String searchFor);

        UserCollection FindUsers(String searchFor);

        GroupCollection GetAdministrativeAccessRightGroups(Int32 sectionId);

        UserCollection GetAdministrativeAccessRightUsers(Int32 sectionId);

        void RemoveGroupAdministrativeAccessRights(Int32 section, IGroup group);

        void RemoveUserAdministrativeAccessRights(Int32 section, IUser user);

        IUser ActivateUser(Guid activationGuid);

        UserCollection GetLatestActivatedUsers(Int32 count);

        Guid AddUserToActivate(IUser user);

        IUser GetUserToActivate(Guid activationGuid);

        void RemoveUserToActivate(Guid activationGuid);

        IUser GetUserToActivateByUserName(String userName);

        void OnRemoveGroup(IRemoveGroupEventArgs args);

        event GroupRemoveEventHandler RemovedGroup;

        void OnCreateGroup(ICreateGroupEventArgs args);

        event GroupCreateEventHandler CreatedGroup;

        void OnUpdateGroup(IUpdateGroupEventArgs args);

        event GroupUpdateEventHandler UpdatedGroup;

        void OnCreateUser(ICreateUserEventArgs args);

        event UserCreateEventHandler CreatedUser;

        void OnRemoveUser(IRemoveUserEventArgs args);

        event RemoveUserEventHandler RemovedUser;

        void OnRestoreUser(IRestoreUserEventArgs args);

        event RestoreUserEventHandler RestoredUser;

        void OnUpdateUser(IUpdateUserEventArgs args);

        event UpdateUserEventHandler UpdatedUser;

        void OnChangeUserPassword(IChangeUserPasswordEventArgs args);

        event ChangeUserPasswordEventHandler ChangedUserPassword;

        Type GetAdminstrativeAccessRightType(Int32 sectionId);

        ISiteAccessRights GetTotalGroupSiteAccessRights(IGroup group, ISite site);

        IModuleAccessRights GetTotalGroupModuleAccessRights(IGroup group, String module);

        ISiteAccessRights GetGroupSiteAccessRights(IGroup group, ISite site);

        IModuleAccessRights GetGroupModuleAccessRights(IGroup group, String module);

        ISiteAccessRights GetTotalUserSiteAccessRights(IUser user, ISite site);

        IModuleAccessRights GetTotalUserModuleAccessRights(IUser user, String module);

        ISiteAccessRights GetUserSiteAccessRights(IUser user, ISite site);

        IModuleAccessRights GetUserModuleAccessRights(IUser user, String module);

        IAdministrativeAccessRights GetGroupAdministrativeAccessRights(IGroup group);

        IAdministrativeAccessRights GetGroupAdministrativeAccessRights(IGroup group, Type type);

        IAdministrativeAccessRights GetInheritedGroupAdministrativeAccessRights(IGroup group);

        IAdministrativeAccessRights GetInheritedGroupAdministrativeAccessRights(IGroup group, Type type);

        IAdministrativeAccessRights GetUserAdministrativeAccessRights(IUser user);

        IAdministrativeAccessRights GetUserAdministrativeAccessRights(IUser user, Type type);

        IAdministrativeAccessRights GetInheritedUserAdministrativeAccessRights(IUser user);

        IAdministrativeAccessRights GetInheritedUserAdministrativeAccessRights(IUser user, Type type);

        UserCollection GetQueryResult(IUserQuery query);

        UserCollection GetQueryResult(IUserQuery query, Int32 page, Int32 pageSize);

        UserCollection GetQueryResult(IUserQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        GroupCollection GetQueryResult(IGroupQuery query);

        GroupCollection GetQueryResult(IGroupQuery query, Int32 page, Int32 pageSize);

        GroupCollection GetQueryResult(IGroupQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        String ToString();

        Boolean Equals(Object obj);

        Int32 GetHashCode();

        Type GetType();
    }
}